package com.dis.insurance.mapper;

import com.dis.pojo.entity.MedicalCard;
import com.dis.pojo.queryDTO.MedicalCardPageQueryDTO;
import com.dis.pojo.vo.MedicalCardVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MedicalCardMapper {
    void insert(MedicalCard medicalCard);
    Page<MedicalCardVO> pageQuery(MedicalCardPageQueryDTO medicalCardPageQueryDTO);
    MedicalCardVO getById(Long id);
    void update(MedicalCard medicalCard);
    void deleteById(Long id);
    void updateStatus(MedicalCard medicalCard);
    /**
     * 根据病人ID查询病人的所有医疗卡(集合)
     */
    List<MedicalCardVO> getByInsureId(@Param("insureId")Long insureId);

    @Select("select * from medical_card where id = #{medicalCardId}")
    MedicalCard getByMedicalCardId(@Param("medicalCardId") String medicalCardId);
}